cd "/Users/gehlbach/Dropbox/Projects/Handbook paper/Data"
clear matrix
clear
set mem 100m
set matsize 500


/* CREATE DATA */

*merge first-stage estimates
use terlist
merge using DTmatrix
drop _merge
sort ter
save priv, replace

*merge regional data (replication data from APSR paper)
use regional
*takes values from 1995 where time-varying
keep if year == 5
drop year
sort ter
merge ter using priv
drop _merge
sort ter
save work, replace

*merge firm-year observations
merge ter using firmyr_obs
drop _merge
save work, replace

replace shoutextract91 = shoutextract91/100
replace pophe94 = pophe94/100
replace distmo = distmo/1000


/* DATA DESCRIPTION */

hist privDT, xtitle("Estimated regional privatization effect")
graph export freqpriv.pdf, replace
hist privDT, xtitle("Estimated regional privatization effect") scheme(s2mono)
graph export freqpriv_bw.pdf, replace
gen SEpriv = SE2priv^.5
scatter SEpriv firmyr_obs, xtitle("Number of firm-year observations") ytitle("Standard error of estimated privatization effect")
graph export se2obs.pdf, replace
scatter SEpriv firmyr_obs, xtitle("Number of firm-year observations") ytitle("Standard error of estimated privatization effect") scheme(s2mono)
graph export se2obs_b2.pdf, replace


/* KITCHEN SINK w/o POLITICS */

reg privDT lnpop urban91 lnburexecreg auton lninc91 shoutextract91 jantemp pophe94 distmo trans border super HHout91 HHemp91, robust
outreg2 using cstable, nolabel bdec(3) bracket replace
*
preserve
global DV "privDT"
global SE2 "SE2privDT"
global GCOL "VprivDT1-VprivDT77"
global RHS "lnpop urban91 lnburexecreg auton lninc91 shoutextract91 jantemp pophe94 distmo trans border super HHout91 HHemp91"
quietly do FGLS
reg y_1 X_*, noc level(90)
outreg2 using cstable, nolabel bdec(3) bracket
restore

/* KITCHEN SINK w/ POLITICS */

reg privDT lnpop urban91 lnburexecreg auton lninc91 shoutextract91 jantemp pophe94 distmo trans border super HHout91 HHemp91 yelt91 demsumavg governm_tr free_media99 mparty, robust
outreg2 using cstable, nolabel bdec(3) bracket
*
preserve
global DV "privDT"
global SE2 "SE2privDT"
global GCOL "VprivDT1-VprivDT77"
global RHS "lnpop urban91 lnburexecreg auton lninc91 shoutextract91 jantemp pophe94 distmo trans border super HHout91 HHemp91 yelt91 demsumavg governm_tr free_media99 mparty"
quietly do FGLS
reg y_1 X_*, noc level(90)
outreg2 using cstable, nolabel bdec(3) bracket
restore

/* ONLY ROBUST DETERMINANTS */

reg privDT lnpop urban91 lnburexecreg auton, robust
outreg2 using cstable, nolabel bdec(3) bracket
*
preserve
global DV "privDT"
global SE2 "SE2privDT"
global GCOL "VprivDT1-VprivDT77"
global RHS "lnpop urban91 lnburexecreg auton"
quietly do FGLS
reg y_1 X_*, noc level(90)
outreg2 using cstable, nolabel bdec(3) bracket
restore





